package com.unisound.tracelog.server.ui.converter;

import com.unisound.tracelog.server.model.entity.TraceLog;
import com.unisound.tracelog.server.ui.model.request.TraceLogListPageRequest;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

@Component
public class TraceLogListPageRequestToTraceLogConverter implements Converter<TraceLogListPageRequest, TraceLog> {
    @Override
    public TraceLog convert(TraceLogListPageRequest source) {
        return TraceLog.builder()
                .name(source.getName())
                .serviceName(source.getServiceName())
                .type(source.getType())
                .build();
    }

}
